﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Data;

namespace LoadCalc
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    /// 
    public partial class MainWindow : Window
    {
        public DataTable load = new DataTable();
        public MainWindow()
        {
            InitializeComponent();
            this.load.Columns.Add("Order");
            this.load.Columns.Add("Weight");
            this.load.Columns.Add("Location");
            this.load.Columns.Add("Length");
            this.load.Columns.Add("Notes");
//add some data 
            this.load.Rows.Add(1, 100, 100, 100, "Load1");
            this.load.Rows.Add(2, 200, 100, 100, "Load2");
            this.load.Rows.Add(3, 300, 100, 100, "Load3");

            Binding bind = new Binding();
            bind.Source = load;
            this.LoadList.SetBinding(ListView.ItemsSourceProperty, bind);
            wt = new List<Window>();
            // windows.Source = this.wt; 
            //Binding windows = new Binding();
            //windows.Source = this.OwnedWindows;
            
            //this.menuWindows.SetBinding(MenuItem.ItemsSourceProperty, windows);
            this.menuWindows.ItemsSource = this.list;
        }
        private List<Window> wt;
        private ObservableCollection<String> list = new ObservableCollection<String>();
        
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            this.Status.Content = "Start calculating!";
            this.Status.Content = "Done!";
        }
        
        private void About_Click_1(object sender, RoutedEventArgs e)
        {
            /*
            Window w = new Window();
            w.Title = "x " + DateTime.Now.ToString();
            wt.Add(w);
            // This works - menItems got added ok
            //MenuItem nitem = new MenuItem();
            //nitem.Header = "x " 
            //this.menuWindows.Items.Add(nitem); 
            w.Owner = this;
            w.Show();
            w.Activate();
             */
            list.Add("x " + DateTime.Now.ToString());
        }
    }
}
